<template>
  <div class="project-Container">
    <el-table :data="List" border style="width: 100%">
      <el-table-column prop="index" label="序号" width="120"></el-table-column>
      <el-table-column prop="nikename" label="用户昵称"></el-table-column>
      <el-table-column label="头像">
        <template slot-scope="scope">
          <img :src="`http://mov.freebd.cn:808/file${scope.row.pic}`" style="height:50px">
        </template>
      </el-table-column>
      <el-table-column prop="phone" label="手机号码"></el-table-column>
      <!-- <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleInfo(scope.$index, scope.row)">认证</el-button>
        </template>
      </el-table-column>-->
    </el-table>

    <div class="paginat">
      <el-pagination
        @current-change="handleCurrentChange"
        :current-page.sync="currentPage4"
        :page-size="10"
        layout="total, prev, pager, next"
        :total="total"
      ></el-pagination>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      search: "",
      val: 1,
      total: 0,
      currentPage4: 1,
      List: []
    };
  },
  created() {
    this.getList();
  },
  methods: {
    //分页
    handleCurrentChange(val) {
      this.val = val;
      this.getList();
      console.log(`当前页: ${val}`);
    },
    //获取数据
    getList() {
      let url = "/user/getusersNo";
      let params = {
        mechanismName: this.search, //机构名称
        pageNum: this.val,
        pageSize: 10
      };
      this.httpPost(url, params, res => {
        if (res.code == 200) {
          this.List = res.data.list;
          this.total = res.data.total;
          this.val = this.val == "" ? 1 : this.val;
          this.List.forEach((element, i) => {
            this.List[i].index = (this.val - 1) * 10 + i + 1;
          });
          console.log(this.List);
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.head {
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  .search {
    width: 300px;
  }
}
</style>